<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>elFinder 2.0</title>

		<!-- jQuery and jQuery UI (REQUIRED) -->
		<link rel="stylesheet" type="text/css" media="screen" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/smoothness/jquery-ui.css">
		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>
		
		<!-- elFinder CSS (REQUIRED) -->
		<link rel="stylesheet" type="text/css" media="screen" href="css/elfinder.min.css">
		<link rel="stylesheet" type="text/css" media="screen" href="css/theme.css">

		<!-- elFinder JS (REQUIRED) -->
		<script type="text/javascript" src="js/elfinder.min.js"></script>

		<!-- elFinder translation (OPTIONAL) -->
		<script type="text/javascript" src="js/i18n/elfinder.ru.js"></script>

		<script src="../grocery_crud/texteditor/tiny_mce_popup.js"></script>
		
		<!-- elFinder initialization (REQUIRED) -->
		<script type="text/javascript">
			var FileBrowserDialogue={
				init:function(){},
				mySubmit:function(URL){
					var win=tinyMCEPopup.getWindowArg('window');
					win.document.getElementById(tinyMCEPopup.getWindowArg('input')).value=URL;
					if (typeof(win.ImageDialog)!='undefined'){
						if (win.ImageDialog.getImageData){
							win.ImageDialog.getImageData();
						}
						if (win.ImageDialog.showPreviewImage){
							win.ImageDialog.showPreviewImage(URL);
						}
					}
					tinyMCEPopup.close();
				}
			};
			tinyMCEPopup.onInit.add(FileBrowserDialogue.init, FileBrowserDialogue);
			$().ready(function(){
				var elf = $('#elfinder').elfinder({
					url:'php/connector.php',
					height:450,
					getFileCallback:function(url){
						FileBrowserDialogue.mySubmit(url);
					}
				}).elfinder('instance');
			});
		</script>
	</head>
	<body>

		<!-- Element where elFinder will be created (REQUIRED) -->
		<div id="elfinder"></div>

	</body>
</html>
